home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / sos3-2.lha / include / knl_use.h < prev    next >
C/C++ Source or Header  |  1991-11-08  |  14KB  |  323 lines

  1. #ifndef knl_SOSH
  2. #define knl_SOSH 1
  3.  
  4. enum sos_Bool { FALSE,TRUE };
  5. enum sos_Eq_kind { EQ_STRONG,EQ_WEAK };
  6. enum sos_Comp_result { CMP_LESS,CMP_EQUAL,CMP_GREATER };
  7. class sos_Object;
  8. class sos_Ordered_object;
  9. class sos_Scalar_object;
  10. class sos_String;
  11. class sos_Named;
  12. class sos_Type;
  13. #include "knl_ext.h"
  14. #define _void_type sos_Id::make(sos_Container::make(15319856),1216)
  15. #define void_type sos_type_object(_void_type,sos_Id::make(sos_Container::make(279048),504144))
  16. sos_Object make_sos_Int_object(sos_Int);
  17. sos_Int make_sos_Int(sos_Object);
  18. #define _sos_Int_type sos_Id::make(sos_Container::make(15319856),1380)
  19. #define sos_Int_type sos_type_object(_sos_Int_type,sos_Id::make(sos_Container::make(279048),504144))
  20. sos_Object make_sos_Char_object(sos_Char);
  21. sos_Char make_sos_Char(sos_Object);
  22. #define _sos_Char_type sos_Id::make(sos_Container::make(15319856),1464)
  23. #define sos_Char_type sos_type_object(_sos_Char_type,sos_Id::make(sos_Container::make(279048),504144))
  24. sos_Object make_sos_Cstring_object(sos_Cstring);
  25. sos_Cstring make_sos_Cstring(sos_Object);
  26. #define _sos_Cstring_type sos_Id::make(sos_Container::make(15319856),1552)
  27. #define sos_Cstring_type sos_type_object(_sos_Cstring_type,sos_Id::make(sos_Container::make(279048),504144))
  28. sos_Object make_sos_Pointer_object(sos_Pointer);
  29. sos_Pointer make_sos_Pointer(sos_Object);
  30. #define _sos_Pointer_type sos_Id::make(sos_Container::make(15319856),1640)
  31. #define sos_Pointer_type sos_type_object(_sos_Pointer_type,sos_Id::make(sos_Container::make(279048),504144))
  32. sos_Object make_sos_Container_object(sos_Container);
  33. sos_Container make_sos_Container(sos_Object);
  34. #define _sos_Container_type sos_Id::make(sos_Container::make(15319856),1732)
  35. #define sos_Container_type sos_type_object(_sos_Container_type,sos_Id::make(sos_Container::make(279048),504144))
  36. sos_Object make_sos_Id_object(sos_Id);
  37. sos_Id make_sos_Id(sos_Object);
  38. #define _sos_Id_type sos_Id::make(sos_Container::make(15319856),1816)
  39. #define sos_Id_type sos_type_object(_sos_Id_type,sos_Id::make(sos_Container::make(279048),504144))
  40. sos_Object make_sos_Offset_object(sos_Offset);
  41. sos_Offset make_sos_Offset(sos_Object);
  42. #define _sos_Offset_type sos_Id::make(sos_Container::make(15319856),1904)
  43. #define sos_Offset_type sos_type_object(_sos_Offset_type,sos_Id::make(sos_Container::make(279048),504144))
  44. inline void bcopy_from_sos_Bool (void *e,void *c)
  45. {  *(sos_Char*)c = (sos_Char)*(sos_Bool*)e; }
  46. inline void bcopy_to_sos_Bool (void *e,void *c)
  47. {  *(sos_Bool*)e = (sos_Bool)*(sos_Char*)c; }
  48. sos_Object make_sos_Bool_object(sos_Bool);
  49. sos_Bool make_sos_Bool(sos_Object);
  50. #define _sos_Bool_type sos_Id::make(sos_Container::make(15319856),3152)
  51. #define sos_Bool_type sos_type_object(_sos_Bool_type,sos_Id::make(sos_Container::make(279048),471440))
  52. inline void bcopy_from_sos_Eq_kind (void *e,void *c)
  53. {  *(sos_Char*)c = (sos_Char)*(sos_Eq_kind*)e; }
  54. inline void bcopy_to_sos_Eq_kind (void *e,void *c)
  55. {  *(sos_Eq_kind*)e = (sos_Eq_kind)*(sos_Char*)c; }
  56. sos_Object make_sos_Eq_kind_object(sos_Eq_kind);
  57. sos_Eq_kind make_sos_Eq_kind(sos_Object);
  58. #define _sos_Eq_kind_type sos_Id::make(sos_Container::make(15319856),3376)
  59. #define sos_Eq_kind_type sos_type_object(_sos_Eq_kind_type,sos_Id::make(sos_Container::make(279048),471440))
  60. inline void bcopy_from_sos_Comp_result (void *e,void *c)
  61. {  *(sos_Char*)c = (sos_Char)*(sos_Comp_result*)e; }
  62. inline void bcopy_to_sos_Comp_result (void *e,void *c)
  63. {  *(sos_Comp_result*)e = (sos_Comp_result)*(sos_Char*)c; }
  64. sos_Object make_sos_Comp_result_object(sos_Comp_result);
  65. sos_Comp_result make_sos_Comp_result(sos_Object);
  66. #define _sos_Comp_result_type sos_Id::make(sos_Container::make(15319856),3672)
  67. #define sos_Comp_result_type sos_type_object(_sos_Comp_result_type,sos_Id::make(sos_Container::make(279048),471440))
  68. class sos_Object: public sos_Root_class 
  69. {  friend class _sos_Object;
  70.    class _sos_Object* _ref;
  71. public:
  72.    static sos_Object make(sos_Typed_id&);
  73.    static sos_Object make(sos_Typed_id&p,_sos_Object*r){
  74.    sos_Object o; o._tpid = p; o._ref=r; return o;}
  75.    static sos_Object make(sos_Root_class&);
  76.    sos_Offset _size();
  77.    static sos_Object create(sos_Container);
  78.    static sos_Object copy(sos_Object,sos_Container);
  79.    static sos_Object clone(sos_Object,sos_Container);
  80.    void destroy();
  81.    void assign(sos_Object source);
  82.    sos_Bool equal(sos_Object o,sos_Eq_kind eq_kind = EQ_STRONG);
  83.    sos_Int hash_value();
  84.    sos_Type type();
  85.    sos_Bool has_type(sos_Type _p1);
  86.    sos_Bool isa(sos_Type _p1);
  87.    sos_Bool is_some(sos_Type _p1);
  88.    sos_Bool is_value();
  89.    sos_Int size();
  90.    sos_Bool identical(sos_Object _p1);
  91.    sos_Bool operator==(sos_Object _p1);
  92.    sos_Bool operator!=(sos_Object _p1);
  93.    sos_Bool like(sos_Object _p1);
  94.    sos_Comp_result compare_ids(sos_Object _p1);
  95. private:
  96.    sos_Id get_type_id();
  97.    void set_type_id(sos_Id _p1);
  98. protected:
  99.    static void local_assign(sos_Object _p1,sos_Object _p2);
  100.    static sos_Bool local_equal(sos_Object _p1,sos_Object _p2,sos_Eq_kind _p3);
  101.    static sos_Int local_hash_value(sos_Object _p1);
  102. };
  103. #define _sos_Object_type sos_Id::make(sos_Container::make(15319856),3764)
  104. #define sos_Object_type sos_type_object(_sos_Object_type,sos_Id::make(sos_Container::make(279048),529560))
  105. class sos_Ordered_object: public sos_Root_class 
  106. {  friend class _sos_Ordered_object;
  107.    class _sos_Ordered_object* _ref;
  108. public:
  109.    operator sos_Object ();
  110.    static sos_Ordered_object make(sos_Typed_id&);
  111.    static sos_Ordered_object make(sos_Typed_id&p,_sos_Ordered_object*r){
  112.    sos_Ordered_object o; o._tpid = p; o._ref=r; return o;}
  113.    static sos_Ordered_object make(sos_Root_class&);
  114.    sos_Offset _size();
  115.    static sos_Ordered_object create(sos_Container);
  116.    static sos_Ordered_object copy(sos_Ordered_object,sos_Container);
  117.    static sos_Ordered_object clone(sos_Ordered_object,sos_Container);
  118.    void destroy();
  119.    void assign(sos_Object source);
  120.    sos_Bool equal(sos_Object o,sos_Eq_kind eq_kind = EQ_STRONG);
  121.    sos_Int hash_value();
  122.    sos_Comp_result compare(sos_Ordered_object _p1);
  123.    sos_Bool operator<(sos_Ordered_object _p1);
  124.    sos_Bool operator<=(sos_Ordered_object _p1);
  125.    sos_Bool operator>(sos_Ordered_object _p1);
  126.    sos_Bool operator>=(sos_Ordered_object _p1);
  127.    sos_Type type();
  128.    sos_Bool has_type(sos_Type _p1);
  129.    sos_Bool isa(sos_Type _p1);
  130.    sos_Bool is_some(sos_Type _p1);
  131.    sos_Bool is_value();
  132.    sos_Int size();
  133.    sos_Bool identical(sos_Object _p1);
  134.    sos_Bool operator==(sos_Object _p1);
  135.    sos_Bool operator!=(sos_Object _p1);
  136.    sos_Bool like(sos_Object _p1);
  137.    sos_Comp_result compare_ids(sos_Object _p1);
  138. protected:
  139.    static void local_assign(sos_Ordered_object x,sos_Ordered_object y);
  140.    static sos_Bool local_equal(sos_Ordered_object x,sos_Ordered_object y,sos_Eq_kind eq_kind = EQ_STRONG);
  141.    static sos_Int local_hash_value(sos_Ordered_object x);
  142. };
  143. #define _sos_Ordered_object_type sos_Id::make(sos_Container::make(15319856),13556)
  144. #define sos_Ordered_object_type sos_type_object(_sos_Ordered_object_type,sos_Id::make(sos_Container::make(279048),529560))
  145. class sos_Scalar_object: public sos_Root_class 
  146. {  friend class _sos_Scalar_object;
  147.    class _sos_Scalar_object* _ref;
  148. public:
  149.    operator sos_Object ();
  150.    static sos_Scalar_object make(sos_Typed_id&);
  151.    static sos_Scalar_object make(sos_Typed_id&p,_sos_Scalar_object*r){
  152.    sos_Scalar_object o; o._tpid = p; o._ref=r; return o;}
  153.    static sos_Scalar_object make(sos_Root_class&);
  154.    sos_Offset _size();
  155.    static sos_Scalar_object create(sos_Container);
  156.    static sos_Scalar_object copy(sos_Scalar_object,sos_Container);
  157.    static sos_Scalar_object clone(sos_Scalar_object,sos_Container);
  158.    void destroy();
  159.    void assign(sos_Object source);
  160.    sos_Bool equal(sos_Object o,sos_Eq_kind eq_kind = EQ_STRONG);
  161.    sos_Int hash_value();
  162. protected:
  163.    static void local_initialize(sos_Scalar_object _p1);
  164.    static void local_finalize(sos_Scalar_object _p1);
  165.    static void local_assign(sos_Scalar_object _p1,sos_Object _p2);
  166.    static sos_Bool local_equal(sos_Scalar_object _p1,sos_Object _p2,sos_Eq_kind _p3);
  167.    static sos_Int local_hash_value(sos_Scalar_object _p1);
  168. public:
  169.    sos_Type type();
  170.    sos_Bool has_type(sos_Type _p1);
  171.    sos_Bool isa(sos_Type _p1);
  172.    sos_Bool is_some(sos_Type _p1);
  173.    sos_Bool is_value();
  174.    sos_Int size();
  175.    sos_Bool identical(sos_Object _p1);
  176.    sos_Bool operator==(sos_Object _p1);
  177.    sos_Bool operator!=(sos_Object _p1);
  178.    sos_Bool like(sos_Object _p1);
  179.    sos_Comp_result compare_ids(sos_Object _p1);
  180. };
  181. #define _sos_Scalar_object_type sos_Id::make(sos_Container::make(15319856),21084)
  182. #define sos_Scalar_object_type sos_type_object(_sos_Scalar_object_type,sos_Id::make(sos_Container::make(279048),529560))
  183. class sos_String: public sos_Root_class 
  184. {  friend class _sos_String;
  185.    class _sos_String* _ref;
  186. public:
  187.    operator sos_Object ();
  188.    operator sos_Ordered_object ();
  189.    static sos_String make(sos_Typed_id&);
  190.    static sos_String make(sos_Typed_id&p,_sos_String*r){
  191.    sos_String o; o._tpid = p; o._ref=r; return o;}
  192.    static sos_String make(sos_Root_class&);
  193.    sos_Offset _size();
  194.    static sos_String create(sos_Container);
  195.    static sos_String copy(sos_String,sos_Container);
  196.    static sos_String clone(sos_String,sos_Container);
  197.    void destroy();
  198.    sos_Int hash_value();
  199.    sos_Cstring make_Cstring();
  200.    void operator+=(sos_String _p1);
  201.    sos_Comp_result compare(sos_Ordered_object _p1);
  202.    sos_Int get_length();
  203. private:
  204.    void set_length(sos_Int _p1);
  205. protected:
  206.    static void local_assign(sos_String _p1,sos_Object _p2);
  207.    static sos_Bool local_equal(sos_String _p1,sos_Object _p2,sos_Eq_kind _p3);
  208. public:
  209.    sos_Bool operator<(sos_Ordered_object _p1);
  210.    sos_Bool operator<=(sos_Ordered_object _p1);
  211.    sos_Bool operator>(sos_Ordered_object _p1);
  212.    sos_Bool operator>=(sos_Ordered_object _p1);
  213.    sos_Bool has_type(sos_Type _p1);
  214.    sos_Bool isa(sos_Type _p1);
  215.    sos_Bool operator==(sos_Object _p1);
  216.    sos_Bool operator!=(sos_Object _p1);
  217.    void assign(sos_Object source);
  218.    sos_Bool equal(sos_Object o,sos_Eq_kind eq_kind = EQ_STRONG);
  219.    void assign_Cstring(sos_Cstring _p1);
  220.    sos_Int size();
  221. private:
  222.    sos_Offset get_address();
  223.    void set_address(sos_Offset _p1);
  224. protected:
  225.    static void local_initialize(sos_String _p1);
  226.    static void local_finalize(sos_String _p1);
  227.    static sos_Int local_hash_value(sos_String _p1);
  228. public:
  229.    sos_Type type();
  230.    sos_Bool is_some(sos_Type _p1);
  231.    sos_Bool is_value();
  232.    sos_Bool identical(sos_Object _p1);
  233.    sos_Bool like(sos_Object _p1);
  234.    sos_Comp_result compare_ids(sos_Object _p1);
  235. };
  236. #define _sos_String_type sos_Id::make(sos_Container::make(15319856),28364)
  237. #define sos_String_type sos_type_object(_sos_String_type,sos_Id::make(sos_Container::make(279048),529560))
  238. class sos_Named: public sos_Root_class 
  239. {  friend class _sos_Named;
  240.    class _sos_Named* _ref;
  241. public:
  242.    operator sos_Object ();
  243.    static sos_Named make(sos_Typed_id&);
  244.    static sos_Named make(sos_Typed_id&p,_sos_Named*r){
  245.    sos_Named o; o._tpid = p; o._ref=r; return o;}
  246.    static sos_Named make(sos_Root_class&);
  247.    sos_Offset _size();
  248.    static sos_Named create(sos_Container);
  249.    static sos_Named copy(sos_Named,sos_Container);
  250.    static sos_Named clone(sos_Named,sos_Container);
  251.    void destroy();
  252.    void assign(sos_Object source);
  253.    sos_Bool equal(sos_Object o,sos_Eq_kind eq_kind = EQ_STRONG);
  254.    sos_Int hash_value();
  255.    sos_String get_name();
  256.    void set_name(sos_String _p1);
  257.    sos_Type type();
  258.    sos_Bool has_type(sos_Type _p1);
  259.    sos_Bool isa(sos_Type _p1);
  260.    sos_Bool is_some(sos_Type _p1);
  261.    sos_Bool is_value();
  262.    sos_Int size();
  263.    sos_Bool identical(sos_Object _p1);
  264.    sos_Bool operator==(sos_Object _p1);
  265.    sos_Bool operator!=(sos_Object _p1);
  266.    sos_Bool like(sos_Object _p1);
  267.    sos_Comp_result compare_ids(sos_Object _p1);
  268. protected:
  269.    static void local_assign(sos_Named x,sos_Named y);
  270.    static sos_Bool local_equal(sos_Named x,sos_Named y,sos_Eq_kind eq_kind = EQ_STRONG);
  271.    static sos_Int local_hash_value(sos_Named x);
  272. };
  273. #define _sos_Named_type sos_Id::make(sos_Container::make(15319856),39164)
  274. #define sos_Named_type sos_type_object(_sos_Named_type,sos_Id::make(sos_Container::make(279048),529560))
  275. class sos_Type: public sos_Root_class 
  276. {  friend class _sos_Type;
  277.    class _sos_Type* _ref;
  278. public:
  279.    operator sos_Object ();
  280.    operator sos_Named ();
  281.    static sos_Type make(sos_Typed_id&);
  282.    static sos_Type make(sos_Typed_id&p,_sos_Type*r){
  283.    sos_Type o; o._tpid = p; o._ref=r; return o;}
  284.    static sos_Type make(sos_Root_class&);
  285.    sos_Offset _size();
  286.    static sos_Type create(sos_Container);
  287.    static sos_Type copy(sos_Type,sos_Container);
  288.    static sos_Type clone(sos_Type,sos_Container);
  289.    void destroy();
  290.    sos_Int hash_value();
  291.    sos_Bool is_derived_from(sos_Type _p1);
  292.    sos_Bool is_derived_from_some(sos_Type _p1);
  293.    sos_Bool is_scalar();
  294.    sos_Type root();
  295.    sos_String get_name();
  296.    void set_name(sos_String _p1);
  297.    sos_Bool has_type(sos_Type _p1);
  298.    sos_Bool isa(sos_Type _p1);
  299.    sos_Bool operator==(sos_Object _p1);
  300.    sos_Bool operator!=(sos_Object _p1);
  301. protected:
  302.    static void local_assign(sos_Type x,sos_Type y);
  303.    static sos_Bool local_equal(sos_Type x,sos_Type y,sos_Eq_kind eq_kind = EQ_STRONG);
  304. public:
  305.    void assign(sos_Object source);
  306.    sos_Bool equal(sos_Object o,sos_Eq_kind eq_kind = EQ_STRONG);
  307.    sos_Type base();
  308.    sos_Int get_object_size();
  309.    void set_object_size(sos_Int _p1);
  310.    sos_Type type();
  311.    sos_Bool is_some(sos_Type _p1);
  312.    sos_Bool is_value();
  313.    sos_Int size();
  314.    sos_Bool identical(sos_Object _p1);
  315.    sos_Bool like(sos_Object _p1);
  316.    sos_Comp_result compare_ids(sos_Object _p1);
  317. protected:
  318.    static sos_Int local_hash_value(sos_Type x);
  319. };
  320. #define _sos_Type_type sos_Id::make(sos_Container::make(15319856),45644)
  321. #define sos_Type_type sos_type_object(_sos_Type_type,sos_Id::make(sos_Container::make(279048),529560))
  322. #endif
  323.